﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Resources | EduCATS Xamarin Documentation </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Resources | EduCATS Xamarin Documentation ">
    <meta name="generator" content="docfx 2.51.0.0">
    
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> 
    <meta property="docfx:navrel" content="../toc">
    <meta property="docfx:tocrel" content="toc">
    
    
    <meta property="docfx:newtab" content="true">
  </head>  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../logo.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
                
                <ul class="nav level1 navbar-nav">
                      <li>
                          <a href="../articles/project-structure.html" title="About project">About project</a>
                      </li>
                      <li>
                          <a href="../api/EduCATS.html" title="Code documentation">Code documentation</a>
                      </li>
                </ul>    </div>
          </div>
        </nav>
      </header>
      <div role="main" class="container body-content hide-when-search">
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div>
              <div class="sidefilter">
                <form class="toc-filter">
                  <span class="glyphicon glyphicon-filter filter-icon"></span>
                  <input type="text" id="toc_filter_input" placeholder="Enter here to filter..." onkeypress="if(event.keyCode==13) {return false;}">
                </form>
              </div>
              <div class="sidetoc">
                <div class="toc" id="toc">
                  
                  <ul class="nav level1">
                    <li class="">
                      <a href="project-structure.html" title="Project structure" class="">Project structure</a>
                    </li>
                    <li class="active">
                      <a href="resources.html" title="Resources" class="active">Resources</a>
                    </li>
                    <li class="">
                      <a href="services.html" title="Services" class="">Services</a>
                    </li>
                    <li class="">
                      <a href="continuous-integration.html" title="Continious integration" class="">Continious integration</a>
                    </li>
                  </ul>        </div>
              </div>
            </div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="">
<h1 id="resources">Resources</h1>

<h2 id="images">Images</h2>
<p>Images should be imported as described <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/images?tabs=windows#local-images">here</a>:</p>
<ul>
<li><p>iOS images should be placed in <code>Asset</code> catalogs according to an application theme (<code>Light.xcassets</code> is used as default).</p>
<ul>
<li><p>Before pushing:</p>
<ul>
<li>Open changed <code>Asset</code> catalogs;</li>
<li>Fix all image sets with exclamation points (choose image set, select items with exclamation points and delete them);</li>
<li>Open <code>Attributes Inspector</code> (<code>View</code> - <code>Inspectors</code> - <code>Show Attributes Inspector</code>);</li>
<li>Select all new image sets;</li>
<li>Set <code>Appearances</code> to <code>None</code>;</li>
<li>Uncheck all <code>Devices</code> except <code>Universal</code> (if you are using only universal icons and images).</li>
</ul>
</li>
<li><p>Push resources with &quot;no contribute&quot; commit in order not to spoil repository contribution statistics (<a href="https://github.com/ilyalehchylin/educats-xamarin/blob/master/.github/CONTRIBUTING.md#commit-pattern-for-docs-update">details here</a>).</p>
</li>
</ul>
</li>
<li><p>Android image should be placed in <code>drawable</code> directory.</p>
</li>
</ul>
<h2 id="fonts">Fonts</h2>
<p>To add new font (<code>.ttf</code> supported only) please follow the next steps:</p>
<ol>
<li><p>Add new font files (Font-Regular and Font-Bold) to <code>EduCATS/Fonts/Resources</code> directory and set build action to <code>EmbeddedResource</code>.</p>
</li>
<li><p>Add the following lines to the <code>EduCATS/Properties/AssemblyInfo.cs</code> file:</p>
</li>
</ol>
<pre><code class="lang-csharp">[assembly: ExportFont(&quot;Font-Regular.ttf&quot;)]
[assembly: ExportFont(&quot;Font-Bold.ttf&quot;)]
</code></pre>
<ol start="3">
<li>If there is no bold version of font, please follow additional steps:</li>
</ol>
<ul>
<li>Open <code>EduCATS/Fonts/FontExclude.cs</code> file.</li>
<li>Add font name to the <code>_excludeList</code>:</li>
</ul>
<pre><code class="lang-csharp">static readonly List&lt;string&gt; _excludeList = new List&lt;string&gt; {
	&quot;Other fonts...&quot;,
  	&quot;Font-Regular&quot;
};
</code></pre>
<ol start="4">
<li>Usage in controls:</li>
</ol>
<pre><code class="lang-csharp">var entry = new Entry {
	FontFamily = FontsController.GetCurrentFont(bold: true),
	FontSize = FontSizeController.GetSize(size, typeof(Entry))
};
</code></pre>
<ol start="5">
<li>If you use base control (like label, entry or button), you can use <code>AppStyles</code> in <code>EduCATS/Heplers/Styles/AppStyles.cs</code>:</li>
</ol>
<pre><code class="lang-csharp">var entry = new Entry {
	Style = AppStyles.GetEntryStyle(size: NamedSize.Large, bold: true)
};
</code></pre>
<h2 id="localization">Localization</h2>
<p>To add a new language, please do the following:</p>
<ol>
<li><p>Copy <code>EduCATS/Localization/**.json</code>.</p>
</li>
<li><p>Translate it to a new language and name it with two-letter language code (<code>ISO 639-1</code>). For example, <code>de.json</code>.</p>
</li>
<li><p>Add it to <code>EduCATS/Localization</code> and set build action to <code>EmbeddedResource</code>.</p>
</li>
<li><p>Open <code>EduCATS/Configuration/AppConfig.cs</code> file, find <code>setupLocalization()</code> method and before add there a new line before <code>CrossLocalization.SetDefaultLanguage(Languages.EN.LangCode);</code>:</p>
</li>
</ol>
<pre><code class="lang-csharp">CrossLocalization.AddLanguageSupport(Languages.DE); // Or whatever language you want
</code></pre>
<p>This automatically will add new language support across the application (including Settings).</p>
<p>More info about localization can be found <a href="https://github.com/nyxbull/CrossLocalization">here</a>.</p>
<h2 id="themes">Themes</h2>
<p>To add a new theme, please follow the next steps:</p>
<ol>
<li><p>Create a new theme class in <code>EduCATS/Themes/Templates</code>;</p>
</li>
<li><p>Inherit from <code>DefaultTheme</code>;</p>
</li>
<li><p>Override properties declared in <code>DefaultTheme</code>:</p>
</li>
</ol>
<pre><code class="lang-csharp">override public string MainSelectedTabColor =&gt; &quot;#27AEE1&quot;;
</code></pre>
<p>To add a new theme color/image/etc. do the following:</p>
<ol>
<li>Add a new property to <code>EduCATS/Themes/Interfaces/ITheme.cs</code>:</li>
</ol>
<pre><code class="lang-csharp">string AppStatusBarBackgroundColor { get; }
</code></pre>
<ol start="2">
<li>Implement it in <code>DefaultTheme.cs</code>:</li>
</ol>
<pre><code class="lang-csharp">virtual public string AppStatusBarBackgroundColor =&gt; &quot;#27AEE1&quot;;
</code></pre>
<ol start="3">
<li>(optional) Override this property in other themes.</li>
</ol>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            Copyright (C) EduCATS. Generated by DocFX.
            
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
